<template>
  <div id="app">
    <router-view />
  </div>
</template>

<script>
export default {
  name: "App",
  created(){
    console.log("进入到appcreated")
    let userObjobj;
    let isAndroid=this.$isAndroid();
    // wx.config({
    //   debug: true, // 开启调试模式,调用的所有api的返回值会在客户端alert出来，若要查看传入的参数，可以在pc端打开，参数信息会通过log打出，仅在pc端时才会打印。
    //   appId: 'wxf7fb194407c5feac', // 必填，公众号的唯一标识
    //   timestamp: '', // 必填，生成签名的时间戳
    //   nonceStr: '', // 必填，生成签名的随机串
    //   signature: '',// 必填，签名
    //   jsApiList: ['chooseImage','getLocation'] // 必填，需要使用的JS接口列表
    // });
    
    // wx.error(function(res){
    //   // config信息验证失败会执行error函数，如签名过期导致验证失败，具体错误信息可以打开config的debug模式查看，也可以在返回的res参数中查看，对于SPA可以在这里更新签名。
    //   console.log("验证失败",res)
    // });
    if(isAndroid){
      console.log("come in android get====== userObj")
      let userstr= window.android.getUserInfo();
      console.log("param==>"+userstr);
      userObjobj=JSON.parse(userstr);
      let ServerUrlStr=window.android.getServerUrl();
      console.log("ServerUrlStr==>"+ServerUrlStr);
      this.$myConfig.ip=ServerUrlStr;
      // 手机顶部状态栏
      window.android.setStatusBarColor(this.$converRgbToArgb(23, 157, 229));
    }else{
      userObjobj= {
        "bigHuaConfig": {
          "dpPassword": "abcd1234",
          "dpUsername": "test",
          "serverIp": "183.250.249.170",
          "serverPort": "9000"
        },
        "configobj": {
          "cadmapurl": "http://map.baidu.com",
          "mapRefreshtime": "30"
        },
        "ftpConfig": {
          "ftpIp": "183.250.249.170",
          "ftpPassword": "123456",
          "ftpPort": "60021",
          "ftpUserName": "ftpuser"
        },
        "isCompany": "0",
        "menuobj": [
          {
            "menualias": "menu_manage",
            "menuid": "2c9196b863389e560163393a1e8e0010",
            "menumodule": "hg-emergencyrescue",
            "menuname": "事件管理"
          },
          {
            "menualias": "menu_feedback",
            "menuid": "4028d9d167ee73fa0167eee8b7be0001",
            "menumodule": "hg-emergencyrescue",
            "menuname": "现场反馈"
          },
          {
            "menualias": "menu_task",
            "menuid": "4028db1e686e2c5e01686e6784680001",
            "menumodule": "hg-emergencyrescue",
            "menuname": "任务管理"
          },
          {
            "menualias": "menu_duty",
            "menuid": "402894ae70719e31017071bd46690004",
            "menumodule": "移动终端",
            "menuname": "事件任务"
          },
          {
            "menualias": "menu_command_dispatch",
            "menuid": "402894ae706080d00170714025860298",
            "menumodule": "移动终端",
            "menuname": "指挥调度"
          },
          {
            "menualias": "menu_knowledge",
            "menuid": "4028d9d167de8c8d0167dee666c70006",
            "menumodule": "mobile_H5",
            "menuname": "知识库"
          },
          {
            "menualias": "menu_map",
            "menuid": "4028d9d167de8c8d0167dee745cd0008",
            "menumodule": "mobile",
            "menuname": "电子地图"
          },
          {
            "menualias": "menu_data_collection",
            "menuid": "4028d9d167e913330167e92190020001",
            "menumodule": "mobile",
            "menuname": "信息采集"
          },
          {
            "menualias": "menu_video_upload",
            "menuid": "402894ae6f6a467e016f79dc82bb0003",
            "menumodule": "移动终端",
            "menuname": "视频回传"
          },
          {
            "menualias": "menu_video_look",
            "menuid": "402894ae6f6a467e016f79dcde8d0005",
            "menumodule": "终端权限",
            "menuname": "视频查看"
          },
          {
            "menualias": "menu_ resource",
            "menuid": "4028d9d167de8c8d0167dee51ea70004",
            "menumodule": "mobile",
            "menuname": "应急资源"
          },
          {
            "menualias": "menu_manage",
            "menuid": "402894ae706080d001707085d73300f2",
            "menumodule": "hg-emergencyrescue",
            "menuname": "事件管理"
          },
          {
            "menualias": "menu_feedback",
            "menuid": "402894ae706080d001707085f45300f4",
            "menumodule": "hg-emergencyrescue",
            "menuname": "现场反馈"
          },
          {
            "menualias": "menu_task",
            "menuid": "402894ae706080d0017070860ca200f6",
            "menumodule": "hg-emergencyrescue",
            "menuname": "任务管理"
          },
          {
            "menualias": "救援队任务管理",
            "menuid": "8a8a8a4c707215f90170721a3c060001",
            "menumodule": "任务",
            "menuname": "任务"
          },
          {
            "menualias": "任务下发",
            "menuid": "8a8a8a4c707215f90170721aaa050003",
            "menumodule": "任务",
            "menuname": "任务下发"
          },
          {
            "menualias": "任务反馈",
            "menuid": "8a8a8a4c707215f90170721b12d40005",
            "menumodule": "任务",
            "menuname": "任务反馈"
          },
          {
            "menualias": "任务反馈测试",
            "menuid": "8a8a8a74707229770170725aa3050001",
            "menumodule": "指挥调度",
            "menuname": "任务反馈测试"
          },
          {
            "menualias": "",
            "menuid": "2c9196b761558ffb016155a2e1450001",
            "menumodule": "知识库",
            "menuname": "知识库"
          },
          {
            "menualias": "SDS",
            "menuid": "2c91963061cfe3220161cfef78720001",
            "menumodule": "hg-knowledgebase",
            "menuname": "MSDS"
          },
          {
            "menualias": "kno",
            "menuid": "4028db7b67de56e80167defd6d710001",
            "menumodule": "知识",
            "menuname": "知识"
          },
          {
            "menualias": "预案",
            "menuid": "4028db7b6831ff050168356ae5360006",
            "menumodule": "epp-manage",
            "menuname": "预案"
          },
          {
            "menualias": "law_and_rule",
            "menuid": "2c9196b761d13d430161d14098da0001",
            "menumodule": "hg-knowledgebase",
            "menuname": "法规标准"
          },
          {
            "menualias": "event_case",
            "menuid": "2c9196b761d4deee0161d4e66583000d",
            "menumodule": "hg-knowledgebase",
            "menuname": "事故案例"
          },
          {
            "menualias": "team_and_material",
            "menuid": "2c91963761cfed0c0161d01042f00001",
            "menumodule": "rescueTeam",
            "menuname": "队伍装备"
          },
          {
            "menualias": "menu_cotnact",
            "menuid": "2c9196fb62273c7e0162276a34e90005",
            "menumodule": "通讯录",
            "menuname": "通讯录管理"
          },
          {
            "menualias": "expert",
            "menuid": "2c91963561d01d2e0161d01f053f0001",
            "menumodule": "专家",
            "menuname": "专家"
          },
          {
            "menualias": "team_and_material",
            "menuid": "2c91962d61dfa1ae0161dfa9f8ea0001",
            "menumodule": "物资装备",
            "menuname": "队伍装备"
          },
          {
            "menualias": "预案（企业）",
            "menuid": "2c91962d62ffeead0163001b7fc9000c",
            "menumodule": "hg-eppmanage",
            "menuname": "预案"
          }
        ],
        "photo": [
          {
            "name": "移动终端",
            "photo": "resources/upload/lunbo.jpg",
            "url": ""
          }
        ],
        "userobj": {
          "icon": "",
          "orgcode": "3503",
          "orgname": "应急指挥中心",
          "teamid": "dizhenys0002",
          "telephone": "",
          "userid": "wuxi",
          "username": "指挥中心值班员"
        }
      }
    };
    console.log("user info ==>"+JSON.stringify(userObjobj.userobj))
    this.$store.commit("setUserInfo",userObjobj.userobj);//赋值user信息
    this.$store.commit("setMenuPriv",userObjobj.menuobj);//赋值菜单权限功能
  },
  mounted(){
  },
  methods: {
  }
};
</script>

<style>
#app {
  height: 100%;
  width: 100%;
}
.el-radio__inner,.el-checkbox__inner{
  border-color:#c6c8c9;
}
</style>
